package com.hystrix;

import com.common.compoent.PrintWriter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * @Author Str
 * @Date 2022/1/17 17:08
 * @Description :
 * @EnableHystrix 该注解将方便客户端启用 Hystrix 断路器，
 * 该注解的作用也仅仅是打开断路器，
 * 并让自动配置找到可用的 Hystrix 类
 * （需要 Hystrix 类库已经在类路径上）
 */
@SpringBootApplication
@EnableFeignClients
@EnableEurekaClient  // Eureka客户端
@EnableHystrix  // 激活服务降级功能
@EnableCircuitBreaker  // 启用熔断器
public class HystrixConsumer9501Application {
    public static void main(String[] args) {
        SpringApplication.run(HystrixConsumer9501Application.class,args);
        PrintWriter.prtMark("服务消费者Hystrix9501已启动");
    }
}
